<h1>Nette\Forms example 1</h1>

<form action="" method="post" enctype="multipart/form-data" onsubmit="return validate(this)">

<ul class="error">
	<li>User error</li>

	<li>
		<strong>User error #2</strong>
	</li>
</ul>


<table>
<tr>
	<th><label for="frm-name">Your name:</label></th>

	<td><input type="text" class="text" name="name" id="frm-name" value="" /></td>
</tr>

<tr>
	<th><label for="frm-age">Your age:</label></th>

	<td><input type="text" size="5" class="text" name="age" id="frm-age" value="" /></td>
</tr>

<tr>
	<th><label for="frm-avatar">Picture:</label></th>

	<td><input type="file" class="text" name="avatar" id="frm-avatar" /></td>
</tr>

<tr>
	<th>&nbsp;</th>

	<td><input type="submit" class="button" name="submit1" id="frm-submit1" value="Send" /></td>
</tr>
</table>

</form>
<script type="text/javascript">
/* <![CDATA[ */
function validate(sender) {
	var element, message, res;
	do {
	element = document.getElementById("frm-age");
	var val = element.value.replace(/^\s+|\s+$/g, '');
	res = parseFloat(val)>=9.9 && parseFloat(val)<=100;
	if (!res) { message = "Age must be in range from 9.90 to 100.00"; if (element) element.focus(); alert(message); return false; }
	} while(0);

	return true;
}

/* ]]> */
</script>
